/**
 * 
 */
package idv.takeshi.software.productline.bookstore.application.service;

import java.util.Locale;
import idv.takeshi.software.productline.bookstore.domain.model.useraccount.UserAccount;
import idv.takeshi.software.productline.bookstore.domain.model.useraccount.UserAccountDuplicateException;

/**
 * Register a user account.
 * @author takeshi
 *
 */
public interface UserRegistrationSerivce {
	
	/**
	 * Register a newly created user account, and then sent a activation mail to user.
	 * @param <T>
	 * @param userAccount
	 * @param locale user using locale
	 * @param hostUrl
	 * @throws UserAccountAlreadyActivatedException 
	 * @throws UserAccountDuplicateException  add a duplicate userAccount
	 */
	public <T extends UserAccount> void addUserAccountAndSendMail(T userAccount, Locale locale, String hostUrl) throws 
		UserAccountAlreadyActivatedException, UserAccountDuplicateException;
	
	/**
	 * Activate a user account by activationKey.
	 * @param activationKey
	 * @throws UserAccountNotFoundException 
	 */
	public void activateUserAccountByActivationKey(String activationKey) throws UserAccountNotFoundException;
	
	/**
	 * Get a user account by given accountName.
	 * @param accountName
	 * @return
	 */
	public UserAccount getUserAccountByName(String accountName);

}
